﻿#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
using namespace std;

int func(int a, int b) {
	if (b == 0) {
		throw 10;
	}
	if (b < 0) {
		throw 'a';
	}
	return a / b; 
}

int main()
{

	try
	{
		//int i = func(2, 0);
		int j = func(2, -1);
	}
	// catch (const std::exception&)
	catch(int i) 
	{
		cout << "抛出int异常" << i << endl;
	}
	catch (char c) {
		cout << "抛出char异常" << c << endl;
	}

	system("pause");
	return EXIT_SUCCESS;
}